Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

order realized VM results by external_id #1194

Merged

Conversation

paulzerkel
Copy link
Contributor

This PR adds external_id as the sortByParam for calls to the realized VM endpoint. This is needed in larger environments (1k+ VMs) because as of NSX-T 3.2.3 the /policy/api/v1/infra/realized-state/virtual-machines endpoint is not respecting a consistent ordering by default. This means that the internal slice representing VMs returned from listAllPolicyVirtualMachines may include duplicates and may be missing VMs that actually exist. Explicitly setting an order forces consistent results across the paginated calls.

Resolves: #1193

@vmwclabot
Copy link
Member

@paulzerkel, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <[email protected]> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

@vmwclabot vmwclabot added the dco-required DCO Required label Apr 22, 2024
This PR adds external_id as the sortByParam for calls to the realized VM
endpoint. This is needed in larger environments (1k+ VMs) because as of
NSX-T 3.2.3 the /policy/api/v1/infra/realized-state/virtual-machines
endpoint is not respecting a consistent ordering by default. This means
that the internal slice representing VMs returned from
listAllPolicyVirtualMachines may include duplicates and may be missing
VMs that actually exist. Explicitly setting an order forces consistent
results across the paginated calls.

Resolves: vmware#1193
Signed-off-by: Paul Zerkel <[email protected]>
@paulzerkel paulzerkel force-pushed the order-listAllPolicyVirtualMachines branch from e7a0b6e to f54e7a2 Compare April 22, 2024 17:03
@vmwclabot vmwclabot removed the dco-required DCO Required label Apr 22, 2024
@annakhm
Copy link
Collaborator

annakhm commented Apr 22, 2024

/test-all

@annakhm
Copy link
Collaborator

annakhm commented Apr 23, 2024

Thank you @paulzerkel, merging this.
Please note that we'll also be changing implementation for pulling VMs via search API rather than getting a full list. Unfortunately this functionality is not supported with NSX 3.2.3, but only starting from 4.1.2.

@annakhm annakhm merged commit 0841c98 into vmware:master Apr 23, 2024
7 checks passed
@paulzerkel
Copy link
Contributor Author

Thanks for the heads up on the new functionality, @annakhm ! That will be a great improvement once we get to that version of NSX-T.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

data nsxt_policy_vm fails to find VM in large (1k+) VM environment
3 participants